var Toast= function() {
};

Toast.prototype.LENGTH_SHORT = 0;
Toast.prototype.LENGTH_LONG = 1;

Toast.prototype.show = function(msg, duration ,successCallback, failureCallback){

	return cordova.exec(
		successCallback,    
		failureCallback,     
		'ToastPlugin', 
		'Toast',              
		[msg, duration]        
	);
};

//lazy use
Toast.prototype.shortshow = function(msg ,successCallback, failureCallback){
	console.log(arguments);
	this.show(msg, this.LENGTH_SHORT ,successCallback, failureCallback);
};

Toast.prototype.longshow = function(msg ,successCallback, failureCallback){	
	this.show(msg, this.LENGTH_LONG ,successCallback, failureCallback);
};

cordova.addConstructor(function() {
    if (!window.plugins) {
		window.plugins = {};
	}
	window.plugins.Toast = new Toast();
});